<?php if(!defined('SABLOG_ROOT')) exit('Access Denied');?>
<div id="submenu">
	<ul>
		<li><a href="cp.php?job=comment&action=cmlist" <!--{if strstr($action, 'cm') && $action != 'modcm'}-->class="focus"<!--{/if}-->><span>评论管理</span></a></li>
		<li><a href="cp.php?job=comment&action=tblist" <!--{if strstr($action, 'tb') && $action != 'tbsendlog'}-->class="focus"<!--{/if}-->><span>引用管理</span></a></li>
		<li><a href="cp.php?job=comment&action=tbsendlog" <!--{if strstr($action, 'log')}-->class="focus"<!--{/if}-->><span>发送记录管理</span></a></li>
		<!--{if $action == 'modcm'}-->
			<li><a href="###" class="focus"><span>编辑评论</span></a></li>
		<!--{/if}-->
	</ul>
</div>

<script type="text/javascript">
function really(d,m) {
	if (confirm(m)) {
		window.location.href='cp.php?job=comment&action='+d;
	}
}
</script>

<div id="wrap">
<p class="p_nav">[ 查看评论: <a href="cp.php?job=comment">全部评论</a> |
  <!--{if $articleid}-->
  <a href="cp.php?job=comment&action=cmlist&articleid=$articleid">文章内全部</a> |
  <!--{/if}-->
  <a href="cp.php?job=comment&action=cmlist&view=hidden&articleid=$articleid">查看已隐藏</a> | <a href="cp.php?job=comment&action=cmlist&view=display&articleid=$articleid">查看已显示</a> | <a href="cp.php?job=comment&action=delallcm"><font color="#FF0000">删除全部</font></a> | <a href="###" onclick="really('displayall','你确定要显示全部评论吗?')">显示全部</a> | <a href="###" onclick="really('hiddenall','你确定要隐藏全部评论吗?')">隐藏全部</a> ] [ 查看引用: <a href="cp.php?job=comment&action=tblist">全部引用</a> |
  <!--{if $articleid}-->
  <a href="cp.php?job=comment&action=tblist&articleid=$articleid">文章内全部</a> |
  <!--{/if}-->
  <a href="cp.php?job=comment&action=tblist&view=display&articleid=$articleid">查看已显示</a> | <a href="cp.php?job=comment&action=tblist&view=hidden&articleid=$articleid">查看已隐藏</a> | <a href="cp.php?job=comment&action=tbclear">清理引用</a> | <a href="cp.php?job=comment&action=tbsendlog">发送记录</a> ]</p>

<form action="cp.php?job=comment" method="POST" name="form1">
	<h2>{$subnav}&raquo;</h2>
<!--{if $action == 'cmlist'}-->
	<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
		<tr class="tdbheader">
			<td nowrap width="5%">状态</td>
			<td nowrap width="15%">作者</td>
			<td nowrap width="20%">联系方式</td>
			<td nowrap width="18%">时间</td>
			<td nowrap width="43%">内容</td>
			<td nowrap width="4%"><input name="chkall" value="on" type="checkbox" onClick="checkall(this.form)" /></td>
		</tr>
		<!--{loop $commentdb $comment}-->
			<!--{eval $thisbg = isset($thisbg) && $thisbg == 'tablecell' ? 'tablecell2' : 'tablecell';}-->
		<tr class="$thisbg" onmouseover="this.className='cellfocus';" onmouseout="this.className='$thisbg';">
			<td nowrap><a href="cp.php?job=comment&action=cmvisible&commentid=$comment[commentid]"><!--{if $comment['visible']}--><span class="yes">显示</span><!--{else}--><span class="no">隐藏</span><!--{/if}--></a></td>
			<td nowrap>$comment[author]<br /><a href="cp.php?job=comment&action=cmlist&ip=$comment[ipaddress]" title="查看此IP同一C段发表的评论">$comment[ipaddress]</a></td>
			<td nowrap>
				<!--{if $comment['email']}-->
					<a href="mailto:{$comment[email]}" target="_blank">$comment[email]</a>
				<!--{else}-->
					<font color="#FF0000">Null</font>
				<!--{/if}-->

				<!--{if $comment['url']}-->
					<a href="$comment[url]" target="_blank"><img src="./templates/admin/images/homelink.gif" border="0" alt="访问该用户的网站" class="attach" /></a>
				<!--{/if}-->
			</td>
			<td nowrap>$comment[dateline]</td>
			<td class="break"><a href="cp.php?job=comment&action=modcm&commentid=$comment[commentid]">$comment[content]</a></td>
			<td nowrap><input type="checkbox" name="comment[]" value="$comment[commentid]" /></td>
		</tr>
		<!--{/loop}-->
		<input type="hidden" name="articleid" value="$articleid" />
		<tr class="tablecell">
			<td colspan="8" nowrap="nowrap"><div class="records">记录:$total</div>
			<div class="multipage">$multipage</div></td>
		</tr>
	</table>
<!--{elseif $action == 'modcm'}-->
	<div class="input">
		<h2>所在文章</h2>
		<p><a href="cp.php?job=article&action=mod&articleid=$comment[articleid]">$comment[title]</a></p>
	</div>
	<div class="input">
		<h2>评论作者</h2>
		<p>
			<input class="formfield" type="text" name="author" size="50" value="$comment[author]" />
		</p>
	</div>
	<div class="input">
		<h2>评论作者主页</h2>
		<p>
			<input class="formfield" type="text" name="url" size="50" value="$comment[url]" />
		</p>
	</div>
	<div class="input">
		<h2>评论作者E-mail</h2>
		<p>
			<input class="formfield" type="text" name="email" size="50" value="$comment[email]" />
		</p>
	</div>
	<div class="input">
		<h2>评论内容</h2>
		<p>
			<textarea class="formarea" type="text" name="content" cols="65" rows="20">$comment[content]</textarea>
		</p>
	</div>
	<div class="submit">
		<input type="hidden" name="commentid" value="$comment[commentid]" />
		<input type="hidden" name="articleid" value="$comment[articleid]" />
		<input type="hidden" name="action" value="domodcm" />
		<button type="submit">确定</button>
	</div>
<!--{elseif $action == 'delallcm'}-->
	<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
    <tr class="alertheader">
      <td>删除所有评论</td>
    </tr>
    <tr>
      <td class="alertbox"><p><b>如果不想显示所有评论,隐藏所有评论即可.</b></p>
        <p><b>这是危险操作且不可恢复,确实要删除所有评论吗?</b></p>
        <p><button type="submit">确定</button>
          <input type="hidden" name="action" value="dodelallcm" />
        </p></td>
    </tr>
	</table>
<!--{elseif in_array($action, array('tblist', 'tbsendlog'))}-->
	<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
    <!--{if $action == 'tblist'}-->
    <tr class="tdbheader">
      <td width="4%" nowrap>状态</td>
      <td width="5%" nowrap>分数</td>
      <td width="30%" nowrap>标题</td>
      <td width="18%" nowrap>来源</td>
      <td width="14%" nowrap>IP</td>
      <td width="14%" nowrap>时间</td>
      <td width="4%" nowrap>文章</td>
      <td width="5%" nowrap><input name="chkall" type="checkbox" onclick="checkall(this.form)" value="on" /></td>
    </tr>
		<!--{loop $trackbackdb $trackback}-->
			<!--{eval $thisbg = isset($thisbg) && $thisbg == 'tablecell' ? 'tablecell2' : 'tablecell';}-->
	<tr class="$thisbg" onmouseover="this.className='cellfocus';" onmouseout="this.className='$thisbg';">
      <td nowrap><a href="cp.php?job=comment&action=tbvisible&trackbackid=$trackback[trackbackid]"><!--{if $trackback['visible']}--><span class="yes">显示</span><!--{else}--><span class="no">隐藏</span><!--{/if}--></a></td>
      <td>$trackback[point]</td>
      <td><a href="$trackback[url]" target="_blank">$trackback[title]</a></td>
      <td nowrap><a href="$trackback[url]" target="_blank">$trackback[blog_name]</a></td>
      <td nowrap><a href="cp.php?job=comment&action=tblist&ip=$trackback[ipaddress]" title="查看此IP同一C段发送的引用">$trackback[ipaddress]</a></a></td>
      <td nowrap>$trackback[dateline]</td>
      <td nowrap><a title="$trackback[article]" href="index.php?action=show&id=$trackback[articleid]" target="_blank">查看</a></td>
      <td nowrap><input type="checkbox" name="trackback[]" value="$trackback[trackbackid]" />
      </td>
    </tr>
		<!--{/loop}-->
        <tr class="tablecell">
          <td colspan="8" nowrap><div class="records">记录:$total</div>
            <div class="multipage">$multipage</div></td>
        </tr>
	<!--{elseif $action == 'tbsendlog'}-->
		<!--{if $articleid}-->
    <input type="hidden" name="action" value="sendpacket" />
    <input type="hidden" name="articleid" value="$articleid" />
    <tr class="tdbheader">
      <td colspan="2">发送引用</td>
    </tr>
    <tr class="tablecell">
      <td>发送文章: </td>
      <td><a href="cp.php?job=article&action=mod&articleid=$articleid">$article[title]</a></td>
    </tr>
    <tr class="tablecell2">
      <td>发送地址:</td>
      <td><input class="formfield" type="text" name="pingurl" size="70" maxlength="255" value="" /></td>
    </tr>
    <tr class="tablecell">
      <td colspan="2" align="center"><button type="submit">确定</button></td>
    </tr>
  </table>
</form>
<br /><form action="cp.php?job=comment" method="POST">
      <table width="100%" align="center" border="0" cellspacing="0" cellpadding="0">
        <!--{/if}-->
        <input type="hidden" name="articleid" value="$articleid" />
        <tr class="tdbheader">
          <td width="35%"><b>发送文章</b></td>
          <td width="42%"><b>发送目标地址</b></td>
          <td width="18%"><b>发送时间</b></td>
          <td width="5%" nowrap><input name="chkall" type="checkbox" onclick="checkall(this.form)" value="on" /></td>
        </tr>
        <!--{loop $tblogdb $tblog}-->
			<!--{eval $thisbg = isset($thisbg) && $thisbg == 'tablecell' ? 'tablecell2' : 'tablecell';}-->
		<tr class="$thisbg" onmouseover="this.className='cellfocus';" onmouseout="this.className='$thisbg';">
          <td nowrap><a href="cp.php?job=article&action=mod&articleid=$tblog[articleid]">$tblog[title]</a></td>
          <td nowrap><a href="$tblog[pingurl]" target="_blank">$tblog[showurl]</a></td>
          <td nowrap>$tblog[dateline]</td>
          <td nowrap><input type="checkbox" name="trackbacklog[]" value="$tblog[trackbacklogid]" /></td>
        </tr>
        <!--{/loop}-->
        <tr class="tablecell">
          <td colspan="4" nowrap><div class="records">记录:$total</div>
            <div class="multipage">$multipage</div></td>
        </tr>
	<!--{/if}-->
	 </table>
<!--{elseif $action == 'tbclear'}-->
        <input type="hidden" name="action" value="dotbclear" />
        <tr class="alertheader">
          <td>删除所有隐藏引用</td>
        </tr>
        <tr>
          <td class="alertbox"><p><b>注意:输入ID后将删除包括此ID之后的所有隐藏和显示的Trackback,不输入或输入任何非数字字符则只删除所有隐藏的Trackback.</b></p>
            <p>输入ID范围:
              <input class="formfield" type="text" name="delid" size="5" value="" />
              可以把鼠标放到引用的状态上,从状态栏获取ID.<br />
            </p>
            <p><b>此操作不可恢复.确定吗?</b></p>
            <p><button type="submit">确定</button></p></td>
        </tr>
<!--{/if}-->
        <tr>
          <td class="tablebottom" colspan="9"></td>
        </tr>
      </table>
<!--{if in_array($action, array('cmlist', 'tblist', 'tbsendlog'))}-->
      <table cellpadding="0" cellspacing="0" border="0" align="center" width="100%" height="40">
        <tr>
          <td align="right">
			<select name="do">
              <option value="">= 管理操作 =</option>
              <!--{if $action == 'cmlist' || $action == 'tblist'}-->
              <option value="hidden">隐藏选定</option>
              <option value="display">显示选定</option>
              <!--{/if}-->
              <option value="del">删除选定</option>
            </select>
			<button type="submit">确定</button>
            <input type="hidden" name="action" value="domore{$action}">
		  </td>
        </tr>
      </table>
<!--{/if}-->
    </form>
</div>